<template>
    <div>
        <p>count的值为: {{ count }}</p>
        <button @click="addCount">count+1</button>
        <button @click="addCountN(5,$event)">count+5</button>
    </div>
</template>

<script setup>
import {ref} from 'vue'
const count = ref(1)
const addCount = event => {
    count.value++
    if(count.value % 2 === 0) {
        event.target.style.border = '3px dotted'
    } else {
        event.target.style.border = '3px soild'
    }
}

const addCountN = (n,event) => {
    count.value += n
    if(count.value % 2 === 0) {
        event.target.style.border = '3px dotted'
    } else {
        event.target.style.border = '3px soild'
    }
}
</script>